import requests
from common.get_header import get_header


class DepartmentAdd(object):
    def department_add(self,req_header, req_data):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/company/department",
                             headers=req_header,json=req_data)
        return resp


if __name__ == '__main__':
    dep = DepartmentAdd()
    req_header = get_header()
    req_body = {"name":"测试部","code":"00003"}
    ret = dep.department_add(req_header, req_body)
    print(ret.json())